package io.sage.modules.integral.service.impl;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import io.sage.modules.integral.dao.TCheckpointMapper;
import io.sage.modules.integral.entity.TCheckpoint;
import io.sage.modules.integral.service.TCheckpointService;

/**
 * 闯关(TCheckpoint)表服务实现类
 *
 * @author makejava
 * @since 2019-05-15 12:23:11
 */
@Service("tCheckpointService")
public class TCheckpointServiceImpl implements TCheckpointService {
	
    @Resource
    private TCheckpointMapper tCheckpointMapper;

	@Override
	public TCheckpoint queryById(Integer id) {
		
		return tCheckpointMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<TCheckpoint> queryAllByLimit(int offset, int limit) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int insert(TCheckpoint tCheckpoint) {
		// TODO Auto-generated method stub
	
		return tCheckpointMapper.insertSelective(tCheckpoint);
	}

	@Override
	public TCheckpoint update(TCheckpoint tCheckpoint) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean deleteById(Integer id) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<TCheckpoint> selectCheckpointList(HashMap<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return tCheckpointMapper.selectCheckpointList(paramMap);
	}

	@Override
	public int save(TCheckpoint checkpoint) {
		checkpoint.setCreateTime(new Date());
		checkpoint.setUpdateTime(new Date());
		checkpoint.setDisFlag(1);
		return tCheckpointMapper.insertSelective(checkpoint);
	}

	@Override
	public TCheckpoint selectByPrimaryKey(Integer id) {
		
		return tCheckpointMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(TCheckpoint checkpoint) {
		
		return tCheckpointMapper.updateByPrimaryKeySelective(checkpoint);
	}

	@Override
	public int stopOrstart(Integer id, Integer disFlag) {
		TCheckpoint sl=new TCheckpoint();
		sl.setId(id);
		sl.setDisFlag(disFlag);

		return tCheckpointMapper.updateByPrimaryKeySelective(sl);
	}

   
}